﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace HelloWorldDemo
{
    public partial class ImgWave : ChildWindow
    {
        public ImgWave()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        bool isMouseEnter = false;
        private void image1_MouseEnter(object sender, MouseEventArgs e)
        {
            isMouseEnter = true;
            //while (isMouseEnter)
            //{
            //    this.rotateTrans.Angle = this.rotateTrans.Angle + 10;
            //    System.Threading.Thread.Sleep(1000);
            //}            
        }

        private void image1_MouseLeave(object sender, MouseEventArgs e)
        {
            isMouseEnter = false;
            this.image1.Opacity = 0.4;
            while (!this.rotateTrans.Angle.Equals(0.0d))
            {
                // this.image1.Opacity += 
                this.rotateTrans.Angle -= 10;
            }
            this.image1.Opacity = 1;
        }
    }
}

